﻿using System;
using Xamarin.Forms;

namespace Games.Common
{
    public static class PageHolder
    {
        private static ContentPage thisPage;
        public static T Get<T>(Func<T> creator) where T : ContentPage
        {
            if(thisPage is T t)
            {
                return t;
            }
            var page = creator();
            thisPage = page;
            return page;
        }
    }
}
